<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>eNewStore</title>

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="<c:url value="/assets/css/bootstrap.css"/>" rel="stylesheet">
    <link href="<c:url value="/assets/css/global.css"/>" rel="stylesheet">
    <link  rel="stylesheet" href="<c:url value="/assets/css/toastr.min.css"/>">
    <link href="<c:url value="/assets/css/dataTables.bootstrap.css"/>" rel="stylesheet">


    <script type='text/javascript' src="<c:url value="/assets/js/jquery-2.0.0.min.js"/>"></script>
    <script type='text/javascript' src="<c:url value="/assets/js/jquery.dataTables.min.js"/>"></script>
    <script type='text/javascript' src="<c:url value="/assets/js/dataTables.bootstrap.js"/>"></script>
    <script type='text/javascript' src="<c:url value="/assets/js/bootstrap.min.js"/>"></script>
    <script type='text/javascript' src="<c:url value="/assets/js/toastr.min.js"/>"></script>
</head>

<!-- HTML code from Bootply.com editor -->

<body>

<!-- Header -->
<jsp:include page="../Menu_template/menuHeader.jsp"/>

<!-- Main -->
<div class="container">

    <!-- upper section -->
    <div class="row">
        <jsp:include page="../Menu_template/menu_sideReappro.jsp"/>
        <!-- /span-3 -->
        <div class="col-md-9">
            <hr>
            <div class="row">
                <!-- center left-->
                <div class="col-md-12">

                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4>Alertes Stocks</h4>
                        </div>
                        <div class="panel-body">
                            <div class="panel-body">
                                <form class="form-signin" role="form"  action="/CalculStock" method="POST">
                                    <button class="btn btn-sm btn-primary" type="submit">Recalcul des Stocks Casier</button>

                                    <c:if test="${not empty sUpdateOK}">
                                        <script>
                                            $(document).ready(function() {
                                                toastr.options.closeButton = true;
                                                toastr.options.debug = false;
                                                toastr.options.positionClass = "toast-bottom-full-width";
                                                toastr.options.showDuration = "300";
                                                toastr.options.hideDuration = "1000";
                                                toastr.options.timeOut = "5000";
                                                toastr.options.extendedTimeOut = "1000";
                                                toastr.options.showEasing = "swing";
                                                toastr.options.hideEasing = "linear";
                                                toastr.options.showMethod = "fadeIn";
                                                toastr.options.hideMethod = "fadeOut";

                                                toastr.success('${sUpdateOK}');
                                            });
                                        </script>
                                    </c:if>
                                </form>
                                <br>
                                <table id="example" class="table table-bordered" cellspacing="0" width="100%">
                                    <thead>
                                    <tr>
                                        <th>IDArticle</th>
                                        <th>RefArticle</th>
                                        <th>Libelle</th>
                                        <th>SousCategorie</th>
                                        <th>StockMini</th>
                                        <th>StockAlerte</th>
                                        <th>StockSecurite</th>
                                        <th>TotalArticle</th>

                                    </tr>
                                    </thead>

                                    <tbody>
                                        <form class="form-signin" role="form" action="/dashboardReappro" method="GET">
                                            <c:forEach var="article" items="${lstArticles}">
                                                <tr class="<c:choose>
                                                                <c:when test="${article.bAlertOrange}">
                                                                   warning
                                                                </c:when>
                                                                <c:when test="${article.bAlertRouge}">
                                                                   danger
                                                                </c:when>
                                                                <c:otherwise>
                                                                    success
                                                                </c:otherwise>
                                                            </c:choose>">
                                                    <td> ${article.eIDArticle}</td>
                                                    <td> ${article.sRefArticle}</td>
                                                    <td> ${article.sLibelle}</td>
                                                    <td> ${article.sSousCat}</td>
                                                    <td> <fmt:formatNumber value="${article.eStockMini}" minFractionDigits="0" maxFractionDigits="0"/></td>
                                                    <td> <fmt:formatNumber value="${article.eStockAlerte}" minFractionDigits="0" maxFractionDigits="0"/></td>
                                                    <td> <fmt:formatNumber value="${article.eStockSecurite}" minFractionDigits="0" maxFractionDigits="0"/></td>

                                                    <td> ${article.eQteTotale}</td>
                                                </tr>
                                            </c:forEach>
                                        </form>
                                    </tbody>
                                </table>
                            </div>


                            <%--<small>Complete</small>--%>
                            <%--<div class="progress">--%>
                                <%--<div class="progress-bar progress-bar-success"--%>
                                     <%--role="progressbar" aria-valuenow="72" aria-valuemin="0"--%>
                                     <%--aria-valuemax="100" style="width: 72%">--%>
                                    <%--<span class="sr-only">72% Complete</span>--%>
                                <%--</div>--%>
                            <%--</div>--%>
                            <%--<small>In Progress</small>--%>
                            <%--<div class="progress">--%>
                                <%--<div class="progress-bar progress-bar-info" role="progressbar"--%>
                                     <%--aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"--%>
                                     <%--style="width: 20%">--%>
                                    <%--<span class="sr-only">20% Complete</span>--%>
                                <%--</div>--%>
                            <%--</div>--%>
                            <%--<small>At Risk</small>--%>
                            <%--<div class="progress">--%>
                                <%--<div class="progress-bar progress-bar-danger"--%>
                                     <%--role="progressbar" aria-valuenow="80" aria-valuemin="0"--%>
                                     <%--aria-valuemax="100" style="width: 80%">--%>
                                    <%--<span class="sr-only">80% Complete</span>--%>
                                <%--</div>--%>
                            <%--</div>--%>
                        </div>
                        <!--/panel-body-->
                    </div>
                    <!--/panel-->
                </div>
                <!--/col-->
            </div>


            <script type='text/javascript'
                    src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


            <script type='text/javascript'
                    src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

        </div>
    </div>
</div>
</body>
</html>